Correcting blockchain transactions with cryptocurrency type mistakes

ABSTRACT

Systems and techniques are provided for blockchain transactions where tokens of a first token type are transferred to a blockchain address of the second token type, the first token type being different than the second token type. In a specific implementation, a token exchange system receives blockchain blocks from one or more blockchain networks. The token exchange system identifies a wrong token type blockchain transaction in the blockchain blocks where the wrong token type blockchain transaction transfers tokens of the first token type to a blockchain address associated with the second token type. The token exchange system executes a fix token type blockchain transaction to correct the wrong token type blockchain transaction.

BACKGROUND Field

The present invention relates to blockchain technology. Moreparticularly, the invention relates to methods and systems forcryptocurrency transactions using blockchain technology.

Description of Related Art

Cryptocurrency is a digital asset that allows for the secure payments ofonline transactions that are denominated in terms of a virtual “token.”Cryptocurrency or the virtual tokens are designed to work as a medium ofexchange in secure transactions between two parties by usingcryptography for security and prevention of counterfeiting and/or fraud.Numerous cryptocurrencies exist today such as Bitcoin™, Ethereum™Credo™, Bitcoin Cash™, Ripple™, Litecoin™, Dash™, Peercoin™, Namecoin™Dogecoin™, Primecoin™, and Mastercoin™.

Cryptocurrency transactions between parties are stored as blockchaintransactions in blockchain networks. A blockchain network is adecentralized and distributed system that hosts electronic ledgers thatcan record transactions efficiently and in a verifiable and permanentway. The electronic ledgers comprise blocks of blockchain transactionsand other information pertinent to the blocks. Each transaction encodesa transfer of control of a number of cryptocurrency or tokens betweentwo or more participants in the blockchain network, senders andrecipients. Each block contains a cryptographic hash of the previousblock, thereby creating a chain of blocks or a “blockchain.” Theblockchain creates a permanent and unalterable electronic ledger of alltransactions which have been written to the blockchain since itsinception. Examples of popular blockchain platforms include Ethereum™,Eris™, Multichain™, Bitcoin™, Litecoin™, Hyperledger Fabric™, CredoBlockchain™, and Hyperledger Corda™.

A blockchain transaction can occur between two or more participants,senders and recipients. The blockchain transaction can be associatedwith a source blockchain address and a destination blockchain address.Both the source blockchain address and the destination blockchainaddress are cryptographic addresses unique to the sender and therecipient respectively. The source blockchain address is generated usinga public key associated with a private key of the sender of the tokensin the transaction. The destination blockchain address is generatedusing a public key associated with a private key of the recipient of thetokens in the transaction. The private key of the recipient is used tosign transactions that claim the tokens transferred to the destinationblockchain address.

The private keys for the participants can be stored in a digital“wallet.” A digital wallet is a software program that maintainsblockchain addresses and private keys held by the participants andsupports the execution of blockchain transactions by which users send orreceive cryptocurrency, pay for goods or save cryptocurrency. Numerouswallet services exist today such as Coinbase™, Bread Wallet™, Mycelium™,Exodus™, Copay™, Jaxx™, Armory™, Trezor™, Ledger Nano™, Green Address™,and Blockchain.info™.

A blockchain network can support only one type of cryptocurrency ortoken type. For example, the blockchain network Credo Blockchain™supports the cryptocurrency Credo™. A blockchain network can alsosupport more than one token type. For example, the blockchain networkBitcoin™ supports the token types Bitcoin™, Bitcoin Cash™ Bitcoin SV™,Bitcoin Gold™, and Bitcoin Diamond™, the blockchain network Ethereum™supports the token types Ethereum™, Ethereum Classic™, and Ethereum 20™,and the blockchain network Litecoin™ supports the token types Litecoin™Litecoin Cash™ and Litecoin Plus™.

Cryptocurrency transactions or transfers of tokens to destinationblockchain addresses can be prone to errors. A destination blockchainaddress for a first token type can be assigned during the initiation andexecution of a blockchain transaction for transferring tokens of asecond token type. For example, Bitcoin™ tokens can be sent to ablockchain address associated with Bitcoin Cash™, or Bitcoin™ tokens canbe sent to a blockchain address associated with Ethereum Classic™.Tokens sent to a destination blockchain address of the wrong token typewill result in the unaccountability of the tokens when estimating thetotal number of tokens held by the destination blockchain address.

Thus, it is desirable to provide a method of detecting blockchaintransactions where tokens are transferred to destination blockchainaddresses of the wrong token types and correct such blockchaintransactions in order to ensure the accountability of the tokens in thefuture.

SUMMARY

A system and a method for a node are provided that can be used fordetecting and correcting blockchain transactions transferring tokens ofa first token type to a blockchain address for a second token type.

In the technology described herein, the node receives blockchain blocksfrom one or more blockchain networks. The blockchain blocks compriseblockchain transactions transferring tokens of a token type from aplurality of token types. The plurality of token types includes at leasta first token type and a second token type. The node identifies wrongtoken type blockchains in the blockchain blocks received from theblockchain networks. A wrong token type blockchain transaction transferstokens of the first token type to a blockchain address associated withthe second token type. The node executes a fix token type blockchaintransaction to transfer the tokens of the first token type from theblockchain address associated with the second token type to a blockchainaddress associated with the first token type. Therefore, the tokens areaccounted for when estimating the total number of tokens held by theblockchain address of the first token type.

In some embodiments, the node maintains a registry of blockchainaddresses. The registry of blockchain addresses includes blockchainaddresses of the participants of cryptocurrency transactions and tokenbalances associated with respective blockchain addresses. Each of theblockchain addresses in the registry of blockchain addresses isassociated with a token type from the plurality of token types.

In some embodiments, the node may select the blockchain addressassociated with the first token type from the registry of blockchainaddresses by matching an identifier of the blockchain address associatedwith the first token type with an identifier of the blockchain addressassociated with the second token type. The identifier of the blockchainaddress associated with the first token type and the identifier of theblockchain address associated with the second token type may be aprivate key needed to sign blockchain transactions associated with thefirst token type and the blockchain address associated with the secondtoken type. In some embodiments, blockchain addresses that can haveoutgoing blockchain transactions signed with a private key have a commonblockchain address format.

In some embodiments, the node may identify deposit blockchaintransactions in the blockchain blocks received from the blockchainnetworks. The deposit blockchain transactions transfer tokens toblockchain addresses in the registry of blockchain addresses. The nodeupdates token balances of the blockchain addresses in the registry ofblockchain addresses upon identification of the deposit blockchaintransactions transferring tokens to the blockchain addresses.

In some embodiments, the node executes withdrawal blockchaintransactions, the blockchain transactions transferring tokens fromblockchain addresses in the registry of blockchain addresses to otherblockchain address. The node updates token balances of the blockchainaddresses in the registry of blockchain addresses.

In some embodiments, the node maintains a registry of token exchangerequests. The registry of token exchange includes a queue of tokenexchange requests. A token exchange request requests an exchange oftokens of the first token type for tokens of the second token type. Insome embodiments, the node may receive token exchange requests, and addthe received token exchange requests to the registry of token exchangerequests. In some embodiments, the node may select a token exchangerequest from the registry of token exchange requests where the tokenexchange request requests a first number of tokens of the first tokentype from a first blockchain address to tokens of the second type to asecond blockchain address. The node may execute a blockchain transactiontransferring a first number of tokens of the first token type from thefirst blockchain address, determine a second number of tokens of thesecond token type equivalent to the first number of tokens of the firsttoken type on dependence upon a token exchange rate of the first tokentype and the second token type, and execute a blockchain transactiontransferring the second number of tokens of the second token type to thesecond blockchain address.

Embodiments of the technology described herein, or elements thereof, canbe implemented in the form of a computer product including anon-transitory computer-readable storage medium with the computer usableprogram code comprising logic for performing the method steps indicated.Furthermore, embodiments of the invention or elements thereof can beimplemented in the form of an apparatus including a memory and at leastone processor that is coupled to the memory and operative to performexemplary method steps. Yet further, in another aspect, embodiments ofthe invention or elements thereof can be implemented in the form ofmeans for carrying out one or more of the method steps described herein;the means can include (i) hardware module(s), (ii) software module(s)executing on one or more hardware processors, or (iii) a combination ofhardware and software modules; any of (i)-(iii) implement the specifictechniques set forth herein, and the software modules are stored in acomputer-readable storage medium (or multiple such media).

These and other features, aspects, and advantages of the invention willbecome apparent from the following detailed description of illustrativeembodiments thereof, which is to be read in connection with theaccompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an example process flow of a token exchange system ina node.

FIG. 2 illustrates an architectural level schematic of an environmentthat includes a token exchange system in accordance with animplementation.

FIG. 3 is a simplified block diagram of a node hosting a token exchangesystem.

FIG. 4 illustrates an example of a token exchange system.

FIG. 5 is a symbolic drawing indicating how the participants database inFIG. 4 is organized, according to an embodiment of the invention.

FIG. 6 is a symbolic drawing indicating how the database including theregistry of blockchain addresses database in FIG. 4 is organized,according to an embodiment of the invention.

FIG. 7 is a symbolic drawing indicating how the database including theregistry of token exchange requests in FIG. 4 is organized, according toan embodiment of the invention.

FIG. 8 is a symbolic drawing indicating how the executed exchangeblockchain transactions database in FIG. 4 is organized, according to anembodiment of the invention.

FIGS. 9A and 9B (hereafter FIG. 9) illustrate an example blockchain datastructure in a blockchain network that implements the technologydisclosed.

FIG. 10 is a sequence diagram illustrating a representative method ofprocessing a new user in the token exchange system by the new userprocessor in FIG. 4.

FIG. 11 is a sequence diagram illustrating a representative method ofprocessing a deposit blockchain transaction in the token exchange systemby the deposit transaction processor in FIG. 4.

FIG. 12 is a sequence diagram illustrating a representative method offixing a wrong token type blockchain transaction in the token exchangesystem by the transaction fixer in FIG. 4.

FIG. 13 is a sequence diagram illustrating a representative method ofprocessing a token exchange request in the token exchange system by theexchange transaction matcher in FIG. 4.

FIG. 14 is a sequence diagram illustrating a representative method ofprocessing a withdrawal blockchain transaction in the token exchangesystem by the withdrawal transaction processor in FIG. 4.

FIG. 15 is a sequence diagram illustrating a representative method ofscheduling various tasks in the token exchange system by the taskscheduler in FIG. 4.

DETAILED DESCRIPTION

A detailed description of embodiments of the present invention isprovided with reference to the FIGS. 1-14. The following description ispresented to enable any person skilled in the art to make and use theinvention, and is provided in the context of a particular applicationand its requirements. Various modifications to the disclosed embodimentswill be readily apparent to those skilled in the art, and the generalprinciples defined herein may be applied to other embodiments andapplications without departing from the spirit and scope of the presentinvention. Thus, the present invention is not intended to be limited tothe embodiments shown but is to be accorded the widest scope consistentwith the principles and features disclosed herein.

A token exchange system enables the exchange of tokens of one token type(e.g., Bitcoin™) into another token type (e.g., Credo™). The tokenexchange service may receive a number of tokens from a participant ofthe token exchange system in the form of one token type to exchange fora number of tokens in the form of a second token type equivalent to thereceived tokens from the participant. The token exchange system mayenable exchanges between a plurality of token types. For example, atoken exchange system may enable token exchanges between the token typesCredo™, Bitcoin™, Bitcoin Cash™, Bitcoin SV™, Bitcoin Gold™, BitcoinDiamond™, Ethereum™, Ethereum Classic™, Ethereum 20™, Litecoin™,Litecoin Cash™, and Litecoin Plus™. Examples of token exchange systemsinclude Coinbase™, Coinmama™, Binance™, CredoEx™, Changelly™, etc. Insome embodiments, the token exchange system can be any cryptocurrencyservices (e.g., e-commerce websites) that enable transactions inmultiple token types or cryptocurrencies.

FIG. 1 illustrates an example process flow 100 of a token exchangesystem. The token exchange system can be implemented on a node, such asa server, coupled to one or more blockchain networks. In someembodiments, the actions in the process flow may be performed indifferent orders and/or with different, fewer or additional actions thanthose illustrated in FIG. 1. Multiple actions can be combined in someimplementations.

The process flow 100 begins at step 110 where the token exchange systemmaintains a registry of blockchain addresses. The registry of blockchainaddresses includes information for blockchain addresses of theparticipants of the token exchange system. A participant of the tokenexchange system may have one or more blockchain addresses in theregistry of blockchain addresses. The registry of blockchain addressesmay include blockchain addresses that can be used as source blockchainaddresses and destination blockchain addresses in blockchaintransactions and token exchange transactions.

In some embodiments, the blockchain address of a participant can berandomly generated using a public key associated with a private key ofthe participant. The public key is used to identify transactionsassociated with the address while the private key is used to sign thetransactions. The public key/private key pair can be produced usingpublic key cryptography. Public key cryptography uses pairs of keys: (i)public keys which may be disseminated widely, and (ii) private keyswhich are known only to the owner of the key. Public key cryptographyaccomplishes two functions: authentication, which is when the public keycan be used to verify that a holder of the paired private key sent themessage, and encryption, whereby only the holder of the paired privatekey can verify the message encrypted with the public key. In a publickey cryptography system, any person can encrypt a message using thepublic key of the receiver, but such a message can be signed only withthe receiver's private key. Private keys can be stored in desktopwallets (wallet service available on that particular machine on whichthe wallet service has been installed), cloud wallets (wallet servicehosted by a third party), mobile wallets (any wallet that exists on adevice that will connect to the internet), hardware wallets (physicaldevices), paper wallets (printing out the private keys on a piece ofpaper which will then be stored in a secure place).

In one embodiment, the private key used to produce the blockchainaddresses can be generated and stored in a digital “wallet.” A digitalwallet is a software program that maintains blockchain addresses andprivate keys held by the account holders, and supports the execution ofblockchain transactions by which users send or receive cryptocurrency,pay for goods or save cryptocurrency. Numerous digital wallets existtoday such as Coinbase™, Bread Wallet™, Mycelium™, Exodus™, Copay™,Jaxx™, Armory™, Trezor™, Ledger Nano™, Green Address™, andBlockchain.info™.

For each blockchain address in the registry of blockchain addresses, theregistry of blockchain address may include a token balance associatedwith the blockchain address. In some embodiments, the token balance of ablockchain address is determined by establishing the difference betweenthe number of tokens transferred in blockchain transactions with theblockchain address as the destination blockchain address and the numberof tokens transferred in blockchain transactions with the blockchainaddress as the source blockchain address.

Each of the blockchain addresses in the registry of blockchain addressesis associated with a token type from the plurality of token typessupported by the token exchange system. The token exchange system mayinclude multiple blockchain addresses in the registry of blockchainaddress for a participant of the token exchange system where each of theblockchain addresses is any one of the token types from the plurality oftoken types. For examples, for a token exchange system that supportstoken exchanges between the token types Credo™, Bitcoin™, Bitcoin Cash™,Bitcoin SV™, Bitcoin Gold™, Bitcoin Diamond™, Ethereum™, EthereumClassic™, Ethereum20™, Litecoin™, Litecoin Cash™ and Litecoin Plus™, theregistry of blockchain addresses may include a blockchain addressassociated with the token type Credo™, a blockchain address associatedwith the token type Bitcoin™, and a blockchain address associated withthe token type Bitcoin Cash™ for a participant of the token exchangesystem.

In some embodiments, the token type associated with a blockchain addresscan be determined by the address format of the blockchain address. Forexample, a blockchain address of the token type Bitcoin™ starts with 1or 3 and contains 27-34 alphanumeric Latin characters (except 0, O, I),a blockchain address of the token type Ethereum™ starts with ‘0x’, and ablockchain address of the token type Bitcoin Cash™ starts with“bitcoincash:”. In other embodiments, the token type associated with theblockchain address may be stored when the address is generated and maybe referred to later.

In some embodiments, the registry of blockchain addresses may includeprivate keys needed to sign transactions that claim the tokensassociated with the blockchain addresses.

Referring to FIG. 1, at step 120, the token exchange system can receiveblockchain blocks from one or more blockchain networks. The node hostingthe token exchange system can act a miner or a non-miner in theblockchain networks from which the node is receiving the blockchainblocks. A blockchain network includes a plurality of nodes hostingcopies of the blockchain. Some of the nodes in the blockchain networkare miners, while the other nodes are non-miners. A miner may also beknown as a staker or a validator. The miners perform the miningoperations in the blockchain network as well as maintain a copy of theblockchain. Mining operations may include validating new transactions,creating new blocks in the blockchain, validating new blockchain blocks,etc. Non-miners can maintain copies of the blockchain without performingany mining operations, though they may perform a subset of operationssuch as partially validating blocks.

The miners in a blockchain network can actively protect the blockchainnetwork by maintaining a consensus algorithm. The miners can construct ablock of blockchain transactions, validate the blockchain transactionsin the block and reach a consensus proof on the block that should beadded next to the blockchain. The newly mined block is then broadcast tothe entire network. While each miner on the blockchain network cancreate its own block, only the block which has a consensus proof isaccepted to be added to the blockchain. The consensus mechanism ensuresthat the nodes agree on the same block to be added to the blockchain.Blockchain offers enhanced security as compared to centralized systemsas every transaction is verified by multiple miners. The integrity ofthe transaction data recorded in the blocks is protected through strongcryptography. In addition to the transaction data, each block contains aconsensus proof of itself and the consensus proof of the previous block.Any attempts to modify a transaction would result in a change in theconsensus proof and would require all the subsequent blocks to berecomputed. This would be extremely difficult to achieve as long as themajority of miners do not cooperate to attack the network. Variousconsensus algorithms are available to miners in blockchain networks. Thetwo main approaches are the proof-of-work algorithm (PoW) and theproof-of-stake algorithm (PoS).

Referring to FIG. 1, at step 130, the token exchange system can identifydeposit blockchain transactions in the blockchain blocks received fromthe blockchain networks. The deposit blockchain transaction may be usedto deposit tokens to blockchain addresses in the registry of blockchainaddresses. The registry of blockchain addresses may aggregate tokensdeposited by participants into their blockchain addresses in theregistry of blockchain addresses where the aggregated token may besecurely stored. To aggregate deposits of tokens, the token exchangesystem may receive a request to deposit an amount of token in ablockchain address through a deposit blockchain transaction where theblockchain address is the destination blockchain address. The tokenexchange system may use the encryption keys (i.e., public key andprivate key) to receive the tokens and credit the token balanceassociated with the blockchain address in the number of tokens received.

In some embodiments, the token exchange system may detect depositblockchain transactions by polling the blockchains in the blockchainnetworks for new blocks containing deposit blockchain transactions. Insome embodiments, the token exchange system may detect depositblockchain transactions in blocks received from other nodes in theblockchain networks.

In some embodiments, the token exchange system may verify the depositblockchain transactions before updating the token balance in theregistry of blockchain addresses. The verification of the depositblockchain transactions is done by confirming transfers of tokens to thedestination blockchain addresses included in the deposit blockchaintransaction. In some embodiments, the deposit blockchain transactionsare verified after the blocks storing the deposit blockchaintransactions reach a predetermined height in the blockchain ledger. Theheight of a block is the number of blocks in the blockchain between theblock and the last block added to the blockchain.

Referring to FIG. 1, at step 140, the token exchange system can identifya wrong token type blockchain transaction in the blockchain blocksreceived from the blockchain networks. A wrong token type blockchaintransaction is a blockchain transaction that transfers tokens of a firsttoken type from the plurality of token types supported by the tokenexchange system to a destination blockchain address associated with thesecond token type. The second token type is also included in theplurality of token types supported by the token exchange system.Examples of wrong token type blockchain transaction include the transferof tokens of the token type Bitcoin™ to a destination blockchain addressof the token type Ethereum™ and transfer of tokens of the token typeBitcoin™ to a destination blockchain address of the token type BitcoinCash™. The token exchange system may identify the token type associatedwith the destination blockchain address of the wrong token typeblockchain by evaluating the address format of the destinationblockchain address.

In some embodiments, the token exchange system may detect wrong tokentype blockchain transactions by polling the blockchains in theblockchain networks for new blocks containing the wrong token typeblockchain transactions. In some embodiments, the token exchange systemmay detect wrong token type blockchain transactions in blocks receivedfrom other nodes in the blockchain networks.

Referring to FIG. 1, at step 150, the token exchange system can composeand execute a fix token type blockchain transaction to redirect thetokens of a first token type in a detected wrong token type blockchaintransaction to a destination blockchain address associated with thefirst token type. The destination blockchain address of the wrong tokentype blockchain transaction can be used as the source blockchain addressof the fix token type blockchain transaction.

In some embodiments, the token exchange system may select the blockchainaddress associated with the first token type from the registry ofblockchain addresses. The node may select the blockchain addressassociated with the first token type by an identifier of the blockchainaddress associated with the second token type with an identifier ofblockchain address associated with the first token type.

Identifiers to be matched for selecting the blockchain address of theright token type can be parameters associated with blockchain addresses.The identifiers used for selection of the blockchain address of theright token type can include for example private keys needed to sign theblockchain addresses, the owner of the blockchain addresses, the addressformat of the blockchain addresses, token types associated with theaddresses, etc. In some embodiments, the blockchain address associatedwith the first token type and the blockchain address associated with thesecond token type can be signed by a private key of a participant. Insome embodiments, blockchain addresses with that can be signed by acommon private key may have a common blockchain address format (i.e.,both the blockchain addresses start with the same string of charactersand/or have the same number of characters). The node may select theblockchain address associated with the second token type by matching theaddress format of the blockchain address associated with the secondtoken type with the address format the blockchain address associatedwith the first token type.

The executed fix token type blockchain transaction is broadcasted toother nodes in the blockchain network from where the wrong token typeblockchain transaction was identified.

Referring to FIG. 1, at step 160, the token exchange system may executeand broadcast withdrawal blockchain transactions. Participants of thetoken exchange system may use the tokens associated with the blockchainaddresses in the registry of blockchain addresses to execute varioustransactions. The withdrawal blockchain transactions transfer tokensfrom blockchain addresses in the registry of blockchain addresses todestination blockchain addresses not included in the registry ofblockchain addresses. To execute a withdrawal blockchain transaction,the token exchange system receives a request from a participantauthorizing payment of a number of tokens to a destination blockchainaddress. The executed withdrawal blockchain transaction is broadcastedto other nodes in the blockchain networks.

Referring to FIG. 1, at step 170, the token exchange system maintains aregistry of token exchange requests. Token exchange requests in theregistry of token exchange requests request exchange of a number oftokens of a first token type from a blockchain address in the registryof blockchain addresses for tokens of a second token type to ablockchain address associated in the registry of blockchain addresses.In some embodiments, the token exchange system receives token exchangerequests from the participants of the token exchange system and adds thereceived token exchange requests to the registry of token exchangerequests.

In some embodiments, exchange transactions between tokens of two tokentypes can be executed as off-chain transactions. The off-chaintransaction includes linking the source blockchain address andencryption keys of the tokens to the destination blockchain address andencryption keys. An off-chain transaction is a transaction that islocally processed by the cryptocurrency service provider, for example,and not recorded on a blockchain network. The participants of the tokenexchange system use the token exchange system as a trusted third partyto record and guarantee the transaction. While a blockchain transactiondepends on the blockchain network to determine its validity, anoff-chain transaction relies on other methods to record and validate thetransaction, such as a payment channel implementing Hashed TimelockContracts, Sidechains, etc. Participants requesting off-chaintransaction must agree to accept the particular method by which thetransaction occurs. Off-chain transactions allow for more immediatetransfer of tokens between two parties, without delays or unavoidabletransaction fees of validating transactions by the blockchain network.During an off-chain transaction, blockchain addresses and private/publickeys associated with the transaction are linked to the recipient. In oneembodiment, “linking” blockchain addresses and keys includes assigningthe blockchain addresses and encryption keys to the receiver. In oneembodiment, “linking” blockchain addresses and keys includes giving thereceiver effective access to the blockchain addresses and encryptionkeys. In another embodiment, “linking” blockchain addresses and keysincludes notifying the trusted third party of the reassignment of theblockchain addresses and keys to the receiver. Off-chain channels, suchas Lightning Network™ and Raiden Network™, also allow off-chaintransactions between various users by creating a relationship betweenthe users and updating token balances after transactions withoutbroadcasting to the blockchain network.

In some embodiments, a token exchange request can be classified as oneof the following categories: a market order, a limit order, a marketsell, and a limit sell. A market order token exchange request is arequest where an amount of tokens of the second type is to be exchangedfor tokens of the first type as quickly as possible at the present ormarket token exchange rate between the first token type and the secondtoken type. A market sell token exchange request is a request where anamount of tokens of the first type is to be exchanged for tokens of thesecond type as quickly as possible at the present or market tokenexchange rate between the first token type and the second token type. Alimit order token exchange request is a request where an amount oftokens of the second type is to be exchanged for tokens of the firsttype as at a minimum or maximum token exchange rate between the firsttoken type and the second token type. A limit sell token exchangerequest is a request where an amount of tokens of the first type is tobe exchanged for tokens of the second type as quickly at a minimum ormaximum token exchange rate between the first token type and the secondtoken type. In some embodiments, additional categories of token exchangerequest such as stop orders may be supported.

Referring to FIG. 1, at step 180, the token exchange system selects atoken exchange request from the registry of token exchange requests, thetoken exchange request requesting a first number of tokens of the firsttoken type from a first blockchain address to tokens of the second typeto a second blockchain address. The token exchange executes a blockchaintransaction transferring a first number of tokens of the first tokentype from the first blockchain address. The token exchange systemdetermines a second number of tokens of the second token type equivalentto the first number of tokens of the first token type on dependence upona token exchange rate of the first token type and the second token type.The token exchange system then executes a blockchain transactiontransferring the second number of tokens of the second token type to thesecond blockchain address. Token exchange requests described in FIG. 1may be associated with a blockchain address through a database relation.

The processes of FIG. 1 and/or FIG. 2 can be implemented using acomputer system storing computer software for execution which has accessto one or more blockchain networks. The network node can be implementedon a machine coupled to the Internet including, and in otherembodiments, a cloud-based server, and in other embodiments, any pointof presence on a network connected to the Internet.

The computer software implementing the process of FIG. 1 and/or FIG. 2can be stored in computer-readable memory, or other non-transitory datastorage medium, for the purposes of distribution to machines to executethe procedures, or for access by a processor or processors executing theprocedure.

System Overview

FIG. 2 illustrates an architectural level schematic of an environment inwhich a token exchange system executing procedures like that of FIG. 1is deployed in a network node 202 on the network 206. As FIG. 2 is anarchitectural diagram, certain details are intentionally omitted toimprove the clarity of the description. The discussion of FIG. 2 will beorganized as follows. First, the elements of the figure will bedescribed, followed by their interconnections.

The system 200 includes the network(s) 206, a blockchain network 208hosting the wallet service I and supporting transactions of the tokentypes A and B, a blockchain network 210 hosting the wallet service IIand supporting transactions of the token types C, D and E, a blockchainnetwork 212 hosting the wallet service III and supporting transactionsof the token types F and G, and a network node 202 hosting a tokenexchange system 204.

Participants 214 are connected to the network node 202 hosting the tokenexchange system 204 through the network 206. In some embodiments,participants 214 may include one or more individuals who utilize thefunctionality of a token exchange system. Participants 214 can interactwith the token exchange system 204 through many devices including insome examples the following devices: a smartphone, a personal computing(PC) device such as a desktop or laptop computer, a media center deviceor other PC derivative, portable media consumption device (mobileterminal, personal digital assistant (PDA), gaming and/or media console,etc.), a tablet computer, other consumer electronic device, or the like.

As used herein, a network node is an active electronic device or virtualdevice that is attached to a network, and is capable of sending,receiving, or forwarding information over a communications channel.Examples of electronic devices which can be deployed as network nodesinclude all varieties of computers, workstations, laptop computers,handheld computers, and smartphones. Network nodes can be implemented ina cloud-based server system. More than one virtual device configured asa network node can be implemented using a single physical device.

For the sake of clarity, only three blockchain networks are shown to beconnected to the network node 202 hosting a token exchange system 204through the network(s) 206. However, any number of blockchain networkscan be connected to the network node 202 hosting the token exchangesystem 204 through the network(s) 206.

The interconnection of the elements of system 200 will now be described.Network(s) 206 couples the electronic devices of the participants 214,the blockchain network 208 hosting the wallet service I and supportingtransactions of the token types A and B, the blockchain network 210hosting the wallet service II and supporting transactions of the tokentypes C, D and E, the blockchain network 212 hosting the wallet serviceIII and supporting transactions of the token types F and G, and thenetwork node 202 hosting the token exchange system 204, all incommunication with each other (indicated by solid double-arrowed lines).

The actual communication path through the Internet can be point-to-pointover public and/or private networks. The communications can occur over avariety of network(s) 206, e.g., private networks, VPN, MPLS circuit, orInternet, and can use appropriate application programming interfaces(APIs) and data interchange formats, e.g., Representational StateTransfer (REST), JavaScript™ Object Notation (JSON), Extensible MarkupLanguage (XML), Simple Object Access Protocol (SOAP), Java™ MessageService (JMS), and/or Java Platform Module System. All of thecommunications can be encrypted. The communication is generally over anetwork such as the LAN (local area network), WAN (wide area network),telephone network (Public Switched Telephone Network (PSTN), SessionInitiation Protocol (SIP), wireless network, point-to-point network,star network, token ring network, hub network, Internet, inclusive ofthe mobile Internet, via protocols such as EDGE, 3G, 4G LTE, Wi-Fi, 5Gand WiMAX. Additionally, a variety of authorization and authenticationtechniques, such as username/password, Open Authorization (OAuth),Kerberos, SecureID, digital certificates and more, can be used to securethe communications.

The blockchain networks 208, 210 and 212 are distributed and publicledgers which maintain records of all the blockchain transactions on theblockchain. In some embodiments. The blockchain networks 208, 210 and212 host wallet services that support one or more token types. Examplesof popular blockchain platforms include Ethereum™, Eris™, Multichain™,Bitcoin™, Hyperledger Fabric™, and Hyperledger Corda™. Participants 214can maintain a cryptocurrency balance and send or receive cryptocurrencythrough the wallet services hosted by the blockchain networks 208, 210and 212. In some embodiments, the network node 202 hosts a tokenexchange system 204 may act as a miner in the blockchain networks 208,210 and/or 212. In some embodiments, the network node 202 hosts a tokenexchange system 204 may act as a non-miner in the blockchain networks208, 210 and/or 212.

Token Exchange System

The network node 202 hosts a token exchange system 204. FIG. 3 is asimplified block diagram of a network node 202 that can be used toimplement the token exchange system 204. The network node 202 typicallyincludes an operating system executed by a processor subsystem 314 whichcommunicates with a number of peripheral devices via bus subsystem 312.These peripheral devices may include a storage subsystem 324, comprisinga memory subsystem 326 and a file storage subsystem 328, user interfaceinput devices 322, user interface output devices 320, and a networkinterface subsystem 316. The input and output devices allow userinteraction with network node 202. Network interface subsystem 316provides an interface to outside network 318 and is coupled via network206 to other elements in system 200. The physical hardware components ofnetwork interfaces are sometimes referred to as network interface cards(NICs), although they need not be in the form of cards; for instancethey could be in the form of integrated circuits (ICs) and connectorsfitted directly onto a motherboard, or in the form of macrocellsfabricated on a single integrated circuit chip with other components ofthe computer system.

User interface input devices 322 may include a keyboard, pointingdevices such as a mouse, trackball, touchpad, or graphics tablet, ascanner, a touchscreen incorporated into the display, audio inputdevices such as voice recognition systems, microphones, and other typesof input devices. In general, use of the term “input device” is intendedto include all possible types of devices and ways to input informationinto network node 202 or onto the network 206.

User interface output devices 320 may include a display subsystem, aprinter, a fax machine, or nonvisual displays such as audio outputdevices. The display subsystem may include a cathode ray tube (CRT), aflat-panel device such as a liquid crystal display (LCD), a projectiondevice, or some other mechanism for creating a visible image. Thedisplay subsystem may also provide a nonvisual display such as via audiooutput devices. In general, use of the term “output device” is intendedto include all possible types of devices and ways to output informationfrom network node 202 to the user or to another machine or network node.In particular, an output device of the network node 202 on which thetoken exchange system 204 is implemented, may include a visual outputinforming a user of action recommendations made by the system, or mayinclude a communication device for communicating action signals.

Storage subsystem 324 stores the basic programming and data constructsthat provide the functionality of certain embodiments of the presentinvention. For example, the various modules implementing thefunctionality of certain embodiments of the invention may be stored instorage subsystem 324. These software modules are generally executed byprocessor subsystem 314.

Memory subsystem 326 typically includes a number of memories including amain random access memory (RAM) 330 for storage of instructions and dataduring program execution and a read-only memory (ROM) 332 in which fixedinstructions are stored. File storage subsystem 328 provides persistentstorage for program and data files, and may include a hard disk drive, afloppy disk drive along with associated removable media, a CD ROM drive,an optical drive, or removable media cartridges. The databases andmodules implementing the functionality of certain embodiments of theinvention may have been provided on a computer-readable medium such asone or more CD-ROMs, volatile memory, non-volatile memory,application-specific integrated circuits (ASICs), field-programmablegate arrays (FPGAs), magnetic and optical storage devices such as diskdrives, magnetic tape, CDs (compact discs), DVDs (digital versatilediscs or digital video discs), or other media capable of storingcomputer-readable media now known or later developed. The databases andmodules implementing the functionality of certain embodiments of theinvention may also be stored by file storage subsystem 328. The hostmemory subsystem 326 contains, among other things, computer instructionswhich, when executed by the processor subsystem 314, cause the computersystem to operate or perform functions as described herein. As usedherein, processes and software that are said to run in or on “the host”,“the computer” or “the network”, execute on the processor subsystem 314in response to computer instructions and data in the host memorysubsystem 326 including any other local or remote storage for suchinstructions and data.

Bus subsystem 312 provides a mechanism for letting the variouscomponents and subsystems of network node 302 communicate with eachother as intended. Although bus subsystem 312 is shown schematically asa single bus, alternative embodiments of the bus subsystem may usemultiple busses.

The network node 202 itself can be of varying types including a personalcomputer, a portable computer, a workstation, a computer terminal, anetwork computer, a television, a mainframe, a server farm, a widelydistributed set of loosely networked computers, or any other dataprocessing system or user device. Due to the ever-changing nature ofcomputers and networks, the description of network node 202 depicted inFIG. 3 is intended only as a specific example for purposes ofillustrating the preferred embodiments of the present invention. Manyother configurations of network node 202 are possible having more orless components than the system depicted in FIG. 3.

In some embodiments, the token exchange system 204 can be implemented inthe network node 202 as a Software-as-a-Service (SaaS) application, aweb-architected application or a cloud-delivered service. Examples ofcommon SaaS applications today include Salesforce.com™, Box™, Dropbox™,Google Apps™, Amazon Web Services AWS™, Microsoft Office365™, Workday™,Oracle on Demand™, Taleo™, Yammer™, and Concur™. SaaS applicationsprovide functionalities to users that are implemented in the cloud, andthat are the target of policies, e.g., logging in, editing userinformation, updating whitelists, deleting contacts from the contactlist, in contrast to the offerings of simple websites and e-commercesites. Note that a SaaS application can be supported by both web browserclients and application clients that use URL-based APIs (applicationprogramming interfaces).

The technology disclosed herein can be implemented in the context of anycomputer-implemented system including a database system, a multi-tenantenvironment, or a relational database implementation like an Oracle™compatible database implementation, an IBM DB2 Enterprise Server™compatible relational database implementation, a MySQL™ or PostgreSQL™compatible relational database implementation or a Microsoft SQL Server™compatible relational database implementation or a NoSQL™ non-relationaldatabase implementation such as a Vampire™ compatible non-relationaldatabase implementation, an Apache Cassandra™ compatible non-relationaldatabase implementation, a BigTable™ compatible non-relational databaseimplementation or an HBase™ or DynamoDB™ compatible non-relationaldatabase implementation. In addition, the technology disclosed can beimplemented using different programming models like MapReduce™, bulksynchronous programming, MPI primitives, etc. or different scalablebatch and stream management systems like Apache Storm™, Apache Spark™,Apache Kafka™, Apache Flink™ Truviso™, Amazon Elasticsearch Service™,Amazon Web Services™ (AWS), IBM Info-Sphere™, Borealis™, and Yahoo! S4™.

FIG. 4 illustrates an example of a token exchange system 204. The tokenexchange system 204 includes software components referred to herein as anew participant processor 416, a deposit transaction processor 418, anexchange transaction matcher 420, a wrong token type transaction fixer422, a withdrawal transaction processor 424 and a task scheduler 428.These components can be distributed between nodes executing emailservers and remote nodes in the network in some embodiments.

The new participant processor 416 processes the sign-up process forregistration of new token exchange system users in the system. Thedeposit transaction processor 418 identifies deposit blockchaintransactions in the blockchain blocks received from the blockchainnetworks 208, 210 and/or 212, and update the token balances of theblockchain addresses in the registry of blockchain addresses uponidentification of deposit blockchain transactions transferring tokens tothe blockchain addresses. The exchange transaction matcher 420 selectstoken exchange requests from a registry of token exchange requests andexecutes the exchange transactions for the token exchange requests. Thewrong token type transaction fixer 422 identifies wrong token typeblockchain transactions in the blockchain blocks received from theblockchain networks 208, 210 and/or 212, and executes fix token typeblockchain transactions to remedy the identified wrong token typeblockchain transaction. The withdrawal transaction processor 424executes and broadcasts withdrawal blockchain transactions. The taskscheduler 428 schedules various tasks in the token exchange system 304,such as requesting the deposit transaction processor 418 to check fornew deposit blockchain transactions in new blockchain blocks receivedfrom the blockchain networks 208, 210 and/or 212, requesting theexchange transaction matcher 420 to process new token exchange requests,and requesting the wrong token type transaction fixer 422 to check fornew wrong token type blockchain transactions in new blockchain blocksreceived from the blockchain networks 208, 210 and/or 212. In someembodiments, the token exchange system 204 may also host an internalwallet service 430 for participants of the token exchange system 204 whowish to store their cryptocurrency balance using the token exchangesystem 204.

The token exchange system 204 also includes a participants database 402,a registry of blockchain addresses 404, a token exchange rates database406, blocks 408, an executed exchange transaction database 410 and aregistry of token exchange requests 412 storing token exchange requests.As used herein, the term “database” does not necessarily imply any unityof structure. For example, two or more separate databases, whenconsidered together, still constitute a “database” as that term is usedherein. Databases can include tables. In some embodiments, the user andregistered email account data are stored in separate tables within asingle database.

FIG. 5 is a symbolic drawing indicating how the participants database402 in FIG. 4 is organized, according to an embodiment of the invention.The participants database 402 contains information regarding theparticipants of the token exchange system. The participants database 402includes a unique user ID 502 for each participant and the name of theparticipant 504. In some embodiments, the participants database 402 canhave separate entries for the first name and surname of the participant.As shown in FIG. 5, some example entries include participant John E.Murphy with user ID 1001 and participant Kristine B. Odaniel with userID 1004. In some embodiments, the participants database 402 may includeother optional participant information 506 that might be helpful for thefunctionality of the token exchange system 204, e.g., the password forthe participant account, the timestamp of last sign in, the timestampfor participant account creation, participant organization, profilepicture, and so on.

FIG. 6 is a symbolic drawing indicating how a database for the registryof blockchain addresses 404 in FIG. 4 is organized, according to anembodiment of the invention. The registry of blockchain addresses 404contains information regarding the blockchain addresses of theparticipants of the token exchange system that can be used to exchangetokens of different token types. Tokens can be deposited to andwithdrawn from the blockchain addresses in the registry of blockchainaddresses 404. The registry of blockchain addresses 404 includes a userID 502 for each blockchain address in the registry. The owner of theblockchain address is identified by the user ID 502 of the owner. Theregistry of blockchain addresses 404 further includes a blockchainaddress 608 associated with the participant with the user ID 502, and atoken type 606 supported by the blockchain address 608. In someembodiments, the registry of blockchain addresses 404 can include theprivate keys needed to sign transactions sent from the blockchainaddress 608. The registry of blockchain addresses 404 also maintains atoken balance for each blockchain address.

In some embodiments, a participant may have information for two or moreblockchain addresses, e.g., user John E. Murphy with user ID 1001 with ablockchain address of the token type A with a token balance of 100tokens of token type A, a blockchain address of the token type C with atoken balance of 2000 tokens of token type B, a blockchain address ofthe token type C with a token balance of 617 tokens of token type C, ablockchain address of the token type D with a token balance of 890tokens of token type D and a blockchain address of the token type F witha token balance of 10000 tokens of token type F.

In some embodiments, the registry of blockchain addresses 404 mayfurther include other optional information 612 that might be helpful forthe functionality of the token exchange system 204, e.g., the timestampfor account creation, the last time account was updated and so on.

FIG. 7 is a symbolic drawing indicating how the database including theregistry of token exchange requests 412 in FIG. 4 is organized,according to an embodiment of the invention. The registry of tokenexchange requests 412 contains information regarding token exchangerequests requested by the participants of the token exchange system. Theregistry of token exchange requests 412 includes a user ID 502 of theparticipant requesting the token exchange and a request ID 702. Theregistry of token exchange requests 412 further includes a sourceblockchain address 706 and the token type associated with the sourceblockchain address 710, and a destination blockchain address 708 and thetoken type associated with the destination blockchain address 712. Boththe source blockchain address and the destination blockchain address areassociated with the participant with the user ID 502. A token exchangerequest requests an exchange of a number of tokens from the sourceblockchain address with a number of tokens from the destinationblockchain address.

In some embodiments, the registry of token exchange requests 412 alsoincludes the category 704 of the exchange, for example, whether theexchange would be a market order, a market sell, a limit sell and alimit order. A market order token exchange request is a request where anamount of tokens of the second type is to be exchanged for tokens of thefirst type as quickly as possible at the present or market tokenexchange rate between the first token type and the second token type. Amarket sell token exchange request is a request where an amount oftokens of the first type is to be exchanged for tokens of the secondtype as quickly as possible at the present or market token exchange ratebetween the first token type and the second token type. A limit ordertoken exchange request is a request where an amount of tokens of thesecond type is to be exchanged for tokens of the first type as at aminimum or maximum token exchange rate between the first token type andthe second token type. A limit sell token exchange request is a requestwhere an amount of tokens of the first type is to be exchanged fortokens of the second type as quickly at a minimum or maximum tokenexchange rate between the first token type and the second token type.

In some embodiments, the registry of token exchange requests 412 mayfurther include other optional information 716 that might be helpful forthe functionality of the token exchange system 204, e.g., the timestampfor the creation of the token exchange request, the minimum or maximumtoken exchange rate for limit sell and order and so on.

The token exchange rates database 406 includes market exchange rates ofthe plurality of token types supported by the token exchange system 204.In some embodiments may be retrieved from services such asCryptoCompare™, CoinMarketCap™ and BitlnfoCharts™.

FIG. 8 is a symbolic drawing indicating how the executed exchangetransactions database 410 in FIG. 4 is organized, according to anembodiment of the invention. The executed exchange transactions database410 contains information regarding executed token exchange requestsrequested by the participants of the token exchange system. The executedexchange transactions database 410 includes a user ID 502 of theparticipant who requested the token exchange and a transaction ID 802.The executed exchange transactions database 410 further includes asource blockchain address 804, a destination blockchain address 808, andthe number of tokens 806 withdrawn from the source blockchain address806 and the number of tokens 810 deposited to the destination blockchainaddress 808. In some embodiments, the executed exchange transactionsdatabase 410 may further include other optional information 812 thatmight be helpful for the functionality of the token exchange system 204,e.g., the timestamp for completion of the token exchange request, theexchange rate used and so on.

Blockchain Network

The token exchange system 204 maintains copies of the blockchains fromthe various blockchain networks 208, 210 and/or 212 in the blocks 408 inFIG. 4. A blockchain in any of the blockchain networks 208, 210 and/or212 includes one or more distributed blockchain ledger data structurescomprising a chain of blocks or “blockchain.” This blockchain ledgerdata structure is replicated among the nodes in the blockchain networks.FIG. 9A illustrates a segment of such a blockchain ledger data structure900, consisting of blocks 910, 920, 930 and 940. For the sake ofclarity, only four blocks are included in FIG. 9A. Any number of blockscan be present in a blockchain structure.

Blockchain transactions 906 are time-stamped and bundled into blockswhere each block is identified by its cryptographic hash called theconsensus proof 902. The consensus proof can be determined by performingcomplex cryptographic computations with a consensus algorithm. Oneskilled in the art would appreciate that, in an implementation, theconsensus proof can be determined by any consensus algorithm.

The blocks 910, 920, 930, 940 form a sequence where each blockreferences the consensus proof of the previous or parent block 904,forming a chain of blocks. In some embodiments, a special data structurecalled a Merkle tree is used to store the blockchain transactions.

Blockchain is a mutation-resistant and durable data structure whichmaintains records of the blockchain transactions that aretamper-resistant. Once a blockchain transaction is recorded in a block,it cannot be altered or deleted as long as a majority of thecomputational or voting power of the network is not controlled by peerswho collude to alter the blockchain. In addition to the transactiondata, each block contains a consensus proof of itself and the consensusproof of the previous block. Any attempts to modify a transaction wouldresult in a change in the consensus proof and would require all thesubsequent blocks to be recomputed. This would be extremely difficult toachieve as long as the majority of miners do not cooperate to attack thenetwork.

FIG. 9B illustrates an example blockchain transaction 950 thatimplements the technology disclosed. The blockchain transaction 950includes a source blockchain address 952 and a destination blockchainaddress 954 associated with the blockchain transaction, a timestamp 956to record the time and date the blockchain transaction was completed,and the amount and type of tokens transferred 958. The blockchaintransaction 950 can also include other components which are not shown inFIG. 9B, such as header, nonce, balance, storage root, code hash, value,signature, ommers hash, beneficiary, state root, transactions root,receipts root, logs bloom, difficulty, number, private key, public key,extra data, and mix hash. One skilled in the art would appreciate that,in other implementations, the blockchain transaction 950 shown in FIG.9B can be distributed across multiple blockchain ledgers in blockchainnodes in a blockchain network.

Processing a New Participant in the Token Exchange System

FIG. 10 is an example workflow 1000 illustrating a representative methodof registering a new participant by the new participant processor 416 inthe token exchange system 204. In some embodiments, the actions in theworkflow may be performed in different orders and with different, feweror additional actions than those illustrated in FIG. 10. Multipleactions can be combined in some implementations.

FIG. 10 includes workflow 1000 that begins at step S10.1 where a newparticipant 1002 signs up as a participant in the token exchange system204. Workflow 1000 continues at step S10.2 where the new participantprocessor 416 adds information about the participant 1002 to theparticipants database 402. At step S10.3, the new participant 1002provides information about his/her account or blockchain addresses inthe wallet service I hosted in the blockchain network 208 to the newparticipant processor 416. At step S10.4, the new participant processor416 retrieves information about the participant's blockchain addressesfrom the wallet service I hosted in the blockchain network 208 and savesthe retrieved information in the registry of blockchain addresses 404 atstep S10.5. Workflow 1000 continues at step S10.6 where the newparticipant 1002 provides information about his/her account orblockchain addresses in the wallet service II hosted in the blockchainnetwork 210 to the new participant processor 416. At step S10.7, the newparticipant processor 416 retrieves information about the participant'sblockchain addresses from the wallet service II hosted in the blockchainnetwork 210 and saves the retrieved information in the registry ofblockchain addresses 404. The participant may provide information abouthis/or account in more wallet services to the new participant processor416.

Processing a Deposit Blockchain Transaction in the Token Exchange System

FIG. 11 is a sequence diagram illustrating a representative method ofprocessing a deposit blockchain transaction in the token exchange systemby the deposit transaction processor 218 in the token exchange system204. In some embodiments, the actions in the workflow may be performedin different orders and with different, fewer or additional actions thanthose illustrated in FIG. 11. Multiple actions can be combined in someimplementations.

FIG. 11 includes workflow 1100 that begins at step S11.1 when thedeposit transaction processor 218 receives a blockchain block fromanother node in the blockchain network 210. The deposit transactionprocessor 218 checks the received blockchain block for depositblockchain transactions where the destination blockchain addresses forthe deposit blockchain transactions are included in the registry ofblockchain addresses 404. At step S11.2, deposit transaction processor218 detects a deposit blockchain transaction. At step S11.3, the deposittransaction processor 218 updates the token balance of the destinationblockchain address included in the detected deposit blockchaintransaction in the registry of blockchain addresses 404.

Processing a Wrong Token Blockchain Transaction in the Token ExchangeSystem

FIG. 12 is a sequence diagram illustrating a representative method offixing a wrong token type blockchain transaction in the token exchangesystem 204 by the wrong token type transaction fixer 422 in FIG. 4. Insome embodiments, the actions in the workflow may be performed indifferent orders and with different, fewer or additional actions thanthose illustrated in FIG. 12. Multiple actions can be combined in someimplementations.

FIG. 12 includes workflow 1200 that begins at step S12.1 when the wrongtoken type transaction fixer 422 receives a blockchain block fromanother node in the blockchain network 210. The wrong token typetransaction fixer 422 checks the received blockchain block for wrongtype blockchain transactions. At step S12.2, the wrong token typetransaction fixer 422 detects a wrong token type blockchain transactiontransfers tokens of a first token type to a destination blockchainaddress associated with a second token type. Examples of wrong tokentype blockchain transaction include the transfer of tokens of the tokentype Bitcoin™ to a destination blockchain address of the token typeEthereum™ and transfer of tokens of the token type Bitcoin™ to adestination blockchain address of the token type Bitcoin Cash™. In someembodiments, the wrong token type transaction fixer 422 may identify thetoken type associated with the destination blockchain address of thewrong token type blockchain by evaluating the address format of thedestination blockchain address.

At step S11.3, the wrong token type transaction fixer 422 selects ablockchain address of the second token type from the registry ofblockchain addresses 404. The wrong token type transaction fixer 422selects the blockchain address associated with the first token type suchthat the blockchain address associated with the first token type and theblockchain address associated with the second token type have a commonprivate key (i.e., both the blockchain addresses can be signed by aprivate key of a participant), such as blockchain addresses for thetoken types Bitcoin™ and Bitcoin Cash™. In some embodiments, blockchainaddresses with a common private key may have a common blockchain addressformat (i.e., both the blockchain addresses start with the same stringof characters and/or have the same number of characters).

At step S11.3, the wrong token type transaction fixer 422 executes a fixtoken type blockchain transaction to redirect the tokens of a firsttoken type to the blockchain address associated with the first tokentype selected at step S11.3. The destination blockchain address of thewrong token type blockchain transaction is used as the source blockchainaddress of the fix token type transaction. The blockchain addressassociated with the first token type selected at step S11.3 is used asthe destination blockchain address of the fix token type transaction.The fix token type blockchain transaction is then broadcasted to theblockchain network 210.

Processing a Token Exchange Request in the Token Exchange System

FIG. 13 is a sequence diagram illustrating a representative method ofprocessing a token exchange request in the token exchange system 204 bythe exchange transaction matcher 420 in FIG. 4. In some embodiments, theactions in the workflow may be performed in different orders and withdifferent, fewer or additional actions than those illustrated in FIG.13. Multiple actions can be combined in some implementations.

FIG. 13 includes workflow 1300 that begins at step S13.1 when aparticipant 1302 of the token exchange system 204 requests an exchangeof an amount of first token type from a source blockchain address totokens of a second token type to a destination blockchain. The tokenexchange request is added to the registry of token exchange requests412. At step S13.2, the exchange transaction matcher 420 selects thetoken exchange request from the registry of token exchange requests. Atstep S13.3, the exchange transaction matcher 420 inquires about theexchange rate of first and second token types from the token exchangerate database 406 and determines the number of tokens of the first tokentype and the number of tokens of the second token type needed for theexchange token transaction. At step S13.4, the exchange transactionmatcher 420 executes a transaction transferring a first number of tokensof the first token type from the source blockchain address. At stepS13.5, the exchange transaction matcher 420 executes a blockchaintransaction transferring the second number of tokens of the second tokentype to the destination blockchain address. At step S13.6, the exchangetransaction matcher 420 saves the exchange transaction in the executedexchange transaction database 410.

Processing a Withdrawal Blockchain Transaction in the Token ExchangeSystem

FIG. 14 is a sequence diagram illustrating a representative method ofprocessing a withdrawal blockchain transaction in the token exchangesystem 204 by the withdrawal transaction processor 424 in FIG. 4. Insome embodiments, the actions in the workflow may be performed indifferent orders and with different, fewer or additional actions thanthose illustrated in FIG. 14. Multiple actions can be combined in someimplementations.

FIG. 14 includes workflow 1400 that begins at step S14.1 when aparticipant 1402 of the token exchange system 204 requests withdrawal ofa number of tokens from a blockchain address in the registry ofblockchain addresses 404 to the withdrawal transaction processor 424. Atstep S14.2, the withdrawal transaction processor 424 executes awithdrawal blockchain transaction with the specified blockchain addressas the source blockchain address and broadcasts the withdrawalblockchain transaction to the blockchain network 208. At step S14.3, thewithdrawal transaction processor 424 updates the token balance of thespecified blockchain address included in the detected deposit blockchaintransaction in the registry of blockchain addresses 404.

Task Scheduling in the Token Exchange System

FIG. 15 is an example workflow 1500 illustrating a representative methodof scheduling various tasks by the task scheduler 428 in the tokenexchange system 204. In some embodiments, the actions in the workflowmay be performed in different orders and/or with different, fewer oradditional actions than those illustrated in FIG. 15. Multiple actionscan be combined in some implementations.

In the workflow 1500, the task scheduler 428 schedules various tasks inthe token exchange system 204, such as requesting the wrong token typetransaction fixer 422 to check for new wrong token type blockchaintransactions (step S15.1). In some embodiments, a participant 1502 canrequest the token exchange system 204 through the wrong token typetransaction fixer 422 to fix a wrong token type blockchain transactionidentified by the participant 1502.

A number of flowcharts illustrating logic executed by a memorycontroller or by memory device are described herein. The logic can beimplemented using processors programmed using computer programs storedin memory accessible to the computer systems and executable by theprocessors, by dedicated logic hardware, including field programmableintegrated circuits, and by combinations of dedicated logic hardware andcomputer programs. With all flowcharts herein, it will be appreciatedthat many of the steps can be combined, performed in parallel orperformed in a different sequence without affecting the functionsachieved. In some cases, as the reader will appreciate, a re-arrangementof steps will achieve the same results only if certain other changes aremade as well. In other cases, as the reader will appreciate, are-arrangement of steps will achieve the same results only if certainconditions are satisfied. Furthermore, it will be appreciated that theflow charts herein show only steps that are pertinent to anunderstanding of the invention, and it will be understood that numerousadditional steps for accomplishing other functions can be performedbefore, after and between those shown.

While the present invention is disclosed by reference to the preferredembodiments and examples detailed above, it is to be understood thatthese examples are intended in an illustrative rather than in a limitingsense. It is contemplated that modifications and combinations willreadily occur to those skilled in the art, which modifications andcombinations will be within the spirit of the invention and the scope ofthe following claims.

What is claimed is:
 1. A method for handling exchanges of a plurality oftoken types, the method comprising: receiving blockchain blocks from oneor more blockchain networks, the blockchain blocks comprising blockchaintransactions transferring tokens of a token type from a plurality oftoken types to blockchain addresses, the plurality of token typesincluding at least a first token type and a second token type;identifying a wrong token type blockchain transaction in the blockchainblocks received from the blockchain networks, the wrong token typeblockchain transaction transferring tokens of the first token type to ablockchain address associated with the second token type; and executinga fix token type blockchain transaction, the fix token type blockchaintransaction transferring the tokens of the first token type from theblockchain address associated with the second token type to a blockchainaddress associated with the first token type.
 2. The method of claim 1,further comprising maintaining a registry of blockchain addresses, theregistry of blockchain addresses including blockchain addresses andtoken balances associated with respective blockchain addresses, and eachof the blockchain addresses in the registry of blockchain addressesassociated with a token type from a plurality of token types.
 3. Themethod of claim 2 further comprising selecting the blockchain addressassociated with the first token type from the registry of blockchainaddresses by matching an identifier of the blockchain address associatedwith the first token type with an identifier of the blockchain addressassociated with the second token type.
 4. The method of claim 3, whereinthe identifier of the blockchain address associated with the first tokentype and the identifier of the blockchain address associated with thesecond token type are a private key needed to sign blockchaintransactions associated with the first token type and the blockchainaddress associated with the second token type.
 5. The method of claim 4,wherein blockchain addresses that can have outgoing blockchaintransactions signed with the private key have a common blockchainaddress format.
 6. The method of claim 2, further comprising:identifying deposit blockchain transactions in the blockchain blocksreceived from the blockchain networks, the deposit blockchaintransactions transferring tokens to blockchain addresses in the registryof blockchain addresses; and updating token balances of the blockchainaddresses in the registry of blockchain addresses upon identification ofthe deposit blockchain transactions transferring tokens to theblockchain addresses.
 7. The method of claim 2, further comprising:executing withdrawal blockchain transactions, the withdrawal blockchaintransactions transferring tokens from blockchain addresses in theregistry of blockchain addresses; and updating token balances of theblockchain addresses in the registry of blockchain addresses.
 8. Themethod of claim 1, further comprising maintaining a registry of tokenexchange requests, token exchange requests in the registry of tokenexchange requests requesting exchanges of tokens of the first token typefor tokens of the second token type.
 9. The method of claim 8, furthercomprising: receiving token exchange requests; and adding the receivedtoken exchange requests to the registry of token exchange requests. 10.The method of claim 8, further comprising: selecting a token exchangerequest from the registry of token exchange requests, the token exchangerequest requesting a first number of tokens of the first token type froma first blockchain address to tokens of the second token type to asecond blockchain address; executing a blockchain transactiontransferring a first number of tokens of the first token type from thefirst blockchain address; determining a second number of tokens of thesecond token type equivalent to the first number of tokens of the firsttoken type on dependence upon a token exchange rate of the first tokentype and the second token type; and executing a blockchain transactiontransferring the second number of tokens of the second token type to thesecond blockchain address.
 11. A node comprising: a processor; and amemory, the processor including logic to: receive blockchain blocks fromone or more blockchain networks, the blockchain blocks comprisingblockchain transactions transferring tokens of a token type from aplurality of token types to blockchain addresses, the plurality of tokentypes including at least a first token type and a second token type;identify a wrong token type blockchain transaction in the blockchainblocks received from the blockchain networks, the wrong token typeblockchain transaction transferring tokens of the first token type to ablockchain address associated with the second token type; and execute afix token type blockchain transaction, the fix token type blockchaintransaction transferring the tokens of the first token type from theblockchain address associated with the second token type to a blockchainaddress associated with the first token type.
 12. The node of claim 11,the processor further including logic to: maintain a registry ofblockchain addresses, the registry of blockchain addresses includingblockchain addresses and token balances associated with respectiveblockchain addresses, and each of the blockchain addresses in theregistry of blockchain addresses associated with a token type from theplurality of token types.
 13. The node of claim 12, the processorfurther including logic to: select the blockchain address associatedwith the first token type from the registry of blockchain addresses bymatching an identifier of the blockchain address associated with thefirst token type with an identifier of the blockchain address associatedwith the second token type.
 14. The node of claim 13, wherein theidentifier of the blockchain address associated with the first tokentype and the identifier of the blockchain address associated with thesecond token type are a private key needed to sign blockchaintransactions associated with the first token type and the blockchainaddress associated with the second token type.
 15. The node of claim 14,wherein blockchain addresses that can have outgoing blockchaintransactions signed with the private key have a common blockchainaddress format.
 16. The node of claim 12, the processor furtherincluding logic to: identify deposit blockchain transactions in theblockchain blocks received from the blockchain networks, the depositblockchain transactions transferring tokens to blockchain addresses inthe registry of blockchain addresses; and update token balances of theblockchain addresses in the registry of blockchain addresses uponidentification of the deposit blockchain transactions transferringtokens to the blockchain addresses.
 17. The node of claim 12, theprocessor further including logic to: execute withdrawal blockchaintransactions, the withdrawal blockchain transactions transferring tokensfrom blockchain addresses in the registry of blockchain addresses; andupdate token balances of the blockchain addresses in the registry ofblockchain addresses.
 18. The node of claim 11, the processor furtherincluding logic to: maintain a registry of token exchange requests,token exchange requests in the registry of token exchange requestsrequesting exchanges of tokens of the first token type for tokens of thesecond token type.
 19. The node of claim 18, the processor furtherincluding logic to: receive token exchange requests; and add thereceived token exchange requests to the registry of token exchangerequests.
 20. The node of claim 8, the processor further including logicto: select a token exchange request from the registry of token exchangerequests, the token exchange request requesting a first number of tokensof the first token type from a first blockchain address to tokens of thesecond token type to a second blockchain address; execute a blockchaintransaction transferring a first number of tokens of the first tokentype from the first blockchain address; determine a second number oftokens of the second token type equivalent to the first number of tokensof the first token type on dependence upon a token exchange rate of thefirst token type and the second token type; and execute a blockchaintransaction transferring the second number of tokens of the second tokentype to the second blockchain address.
 21. A computer program product,comprising: a non-transitory machine readable memory; a computer programstored in the memory, the computer program including instructionsconfigured for execution of a procedure in a node, comprising: receivingblockchain blocks from one or more blockchain networks, the blockchainblocks comprising blockchain transactions transferring tokens of a tokentype from a plurality of token types to blockchain addresses, theplurality of token types including at least a first token type and asecond token type; identifying a wrong token type blockchain transactionin the blockchain blocks received from the blockchain networks, thewrong token type blockchain transaction transferring tokens of the firsttoken type to a blockchain address associated with the second tokentype; and executing a fix token type blockchain transaction, the fixtoken type blockchain transaction transferring the tokens of the firsttoken type from the blockchain address associated with the second tokentype to a blockchain address associated with the first token type. 22.The computer program product of claim 21, further including maintaininga registry of blockchain addresses, the registry of blockchain addressesincluding blockchain addresses and token balances associated withrespective blockchain addresses, and each of the blockchain addresses inthe registry of blockchain addresses associated with a token type from aplurality of token types.
 23. The computer program product of claim 22further comprising selecting the blockchain address associated with thefirst token type from the registry of blockchain addresses by matchingan identifier of the blockchain address associated with the first tokentype with an identifier of the blockchain address associated with thesecond token type.
 24. The computer program product of claim 23, whereinthe identifier of the blockchain address associated with the first tokentype and the identifier of the blockchain address associated with thesecond token type are a private key needed to sign blockchaintransactions associated with the first token type and the blockchainaddress associated with the second token type.
 25. The computer programproduct of claim 24, wherein blockchain addresses that can have outgoingblockchain transactions signed with the private key have a commonblockchain address format.
 26. The computer program product of claim 22,further comprising: identifying deposit blockchain transactions in theblockchain blocks received from the blockchain networks, the depositblockchain transactions transferring tokens to blockchain addresses inthe registry of blockchain addresses; and updating token balances of theblockchain addresses in the registry of blockchain addresses uponidentification of the deposit blockchain transactions transferringtokens to the blockchain addresses.
 27. The computer program product ofclaim 22, further comprising: executing withdrawal blockchaintransactions, the withdrawal blockchain transactions transferring tokensfrom blockchain addresses in the registry of blockchain addresses; andupdating token balances of the blockchain addresses in the registry ofblockchain addresses.
 28. The computer program product of claim 21,further comprising maintaining a registry of token exchange requests,token exchange requests in the registry of token exchange requestsrequesting exchanges of tokens of the first token type for tokens of thesecond token type.
 29. The computer program product of claim 28, furthercomprising: receiving token exchange requests; and adding the receivedtoken exchange requests to the registry of token exchange requests. 30.The computer program product of claim 28, further comprising: selectinga token exchange request from the registry of token exchange requests,the token exchange request requesting a first number of tokens of thefirst token type from a first blockchain address to tokens of the secondtoken type to a second blockchain address; executing a blockchaintransaction transferring a first number of tokens of the first tokentype from the first blockchain address; determining a second number oftokens of the second token type equivalent to the first number of tokensof the first token type on dependence upon a token exchange rate of thefirst token type and the second token type; and executing a blockchaintransaction transferring the second number of tokens of the second tokentype to the second blockchain address.
 31. A node comprising: aprocessor; and a memory, the processor including logic to: receiveblockchain blocks from one or more blockchain networks, the blockchainblocks comprising blockchain transactions transferring tokens of a tokentype from a plurality of token types to blockchain addresses, theplurality of token types including at least a first token type and asecond token type; maintain a registry of blockchain addresses, theregistry of blockchain addresses including blockchain addresses andtoken balances associated with respective blockchain addresses, and eachof the blockchain addresses in the registry of blockchain addressesassociated with a token type from the plurality of token types; identifydeposit blockchain transactions in the blockchain blocks received fromthe blockchain networks, the blockchain transactions transferring tokensto blockchain addresses in the registry of blockchain addresses, andupdate the token balances of the blockchain addresses in the registry ofblockchain addresses upon identification of deposit blockchaintransactions transferring tokens to the blockchain addresses; identify awrong token type blockchain transactions in the blockchain blocksreceived from the blockchain networks, the wrong token type blockchaintransaction transferring tokens of the first token type to a blockchainaddress associated with the second token type; execute a fix token typeblockchain transaction, the fix token type blockchain transactiontransferring the tokens of the first token type from the blockchainaddress associated with the second token type to a blockchain addressassociated with the first token type; execute withdrawal blockchaintransactions, the blockchain transactions transferring tokens fromblockchain addresses in the registry of blockchain addresses; maintain aregistry of token exchange requests, token exchange requests in theregistry of token exchange requests requesting exchange of tokens of thefirst token type from a blockchain address associated with the firsttoken type in the registry of blockchain addresses for tokens of thesecond token type to a blockchain address associated with a second tokentype in the registry of blockchain addresses; receive a token exchangerequest, and add the received token exchange request to the registry oftoken exchange requests; select a token exchange request from theregistry of token exchange requests, execute a blockchain transactiontransferring the tokens of the first token type from the blockchainaddress associated with the first token type; and execute a blockchaintransaction transferring the tokens of the second token type to theblockchain address associated with the second token type.
 32. A methodfor handling exchanges of a plurality of token types, the methodcomprising: receiving blockchain blocks from one or more blockchainnetworks, the blockchain blocks comprising blockchain transactionstransferring tokens of a token type from a plurality of token types toblockchain addresses, the plurality of token types including at least afirst token type and a second token type; maintaining a registry ofblockchain addresses, the registry of blockchain addresses includingblockchain addresses and token balances associated with respectiveblockchain addresses, and each of the blockchain addresses in theregistry of blockchain addresses associated with a token type from theplurality of token types; identifying deposit blockchain transactions inthe blockchain blocks received from the blockchain networks, theblockchain transactions transferring tokens to blockchain addresses inthe registry of blockchain addresses, and update the token balances ofthe blockchain addresses in the registry of blockchain addresses uponidentification of deposit blockchain transactions transferring tokens tothe blockchain addresses; identifying a wrong token type blockchaintransactions in the blockchain blocks received from the blockchainnetworks, the wrong token type blockchain transaction transferringtokens of the first token type to a blockchain address associated withthe second token type; executing a fix token type blockchaintransaction, the fix token type blockchain transaction transferring thetokens of the first token type from the blockchain address associatedwith the second token type to a blockchain address associated with thefirst token type; executing withdrawal blockchain transactions, theblockchain transactions transferring tokens from blockchain addresses inthe registry of blockchain addresses; maintaining a registry of tokenexchange requests, token exchange requests in the registry of tokenexchange requests requesting exchange of tokens of the first token typefrom a blockchain address associated with the first token type in theregistry of blockchain addresses for tokens of the second token type toa blockchain address associated with a second token type in the registryof blockchain addresses; receiving a token exchange request, and add thereceived token exchange request to the registry of token exchangerequests; selecting a token exchange request from the registry of tokenexchange requests, execute a blockchain transaction transferring thetokens of the first token type from the blockchain address associatedwith the first token type; and execute a blockchain transactiontransferring the tokens of the second token type to the blockchainaddress associated with the second token type.
 33. A computer programproduct, comprising: a non-transitory machine readable memory; acomputer program stored in the memory, the computer program includinginstructions configured for execution of a procedure in a node,comprising: receiving blockchain blocks from one or more blockchainnetworks, the blockchain blocks comprising blockchain transactionstransferring tokens of a token type from a plurality of token types toblockchain addresses, the plurality of token types including at least afirst token type and a second token type; maintaining a registry ofblockchain addresses, the registry of blockchain addresses includingblockchain addresses and token balances associated with respectiveblockchain addresses, and each of the blockchain addresses in theregistry of blockchain addresses associated with a token type from theplurality of token types; identifying deposit blockchain transactions inthe blockchain blocks received from the blockchain networks, theblockchain transactions transferring tokens to blockchain addresses inthe registry of blockchain addresses, and update the token balances ofthe blockchain addresses in the registry of blockchain addresses uponidentification of deposit blockchain transactions transferring tokens tothe blockchain addresses; identifying a wrong token type blockchaintransactions in the blockchain blocks received from the blockchainnetworks, the wrong token type blockchain transaction transferringtokens of the first token type to a blockchain address associated withthe second token type; executing a fix token type blockchaintransaction, the fix token type blockchain transaction transferring thetokens of the first token type from the blockchain address associatedwith the second token type to a blockchain address associated with thefirst token type; executing withdrawal blockchain transactions, theblockchain transactions transferring tokens from blockchain addresses inthe registry of blockchain addresses; maintaining a registry of tokenexchange requests, token exchange requests in the registry of tokenexchange requests requesting exchange of tokens of the first token typefrom a blockchain address associated with the first token type in theregistry of blockchain addresses for tokens of the second token type toa blockchain address associated with a second token type in the registryof blockchain addresses; receiving a token exchange request, and add thereceived token exchange request to the registry of token exchangerequests; selecting a token exchange request from the registry of tokenexchange requests, execute a blockchain transaction transferring thetokens of the first token type from the blockchain address associatedwith the first token type; and execute a blockchain transactiontransferring the tokens of the second token type to the blockchainaddress associated with the second token type.